import React,{Component} from 'react';
import ReactDOM from 'react-dom';
/* export default (WrappedComponent) => {
	class HighOrderComponent extends Component{
		render() {
			return <WrappedComponent/>
		}
	}
	return HighOrderComponent;
} */

export default (WrappedComponent,name) => {
	class HighOrderComponent extends Component{
		constructor() {
			super();
			this.state={data:null};
		}

		componentWillMount() {
			let data=localStorage.getItem(name);
			this.setState({data});
		}

		render() {
			return <WrappedComponent data={this.state.data}/>
		}
	}
	return HighOrderComponent;
}
